package pers.whj.util;

/**
 * implement this to set a priority
 */
public interface Priority<T> extends Comparable<T> {
    void setPriority(int priority);

    int getPriority();

    @Override
    @SuppressWarnings({"unchecked"})
    default int compareTo(T obj) {
        return getPriority() - ((Priority<T>) obj).getPriority();
    }
}